package com.sg.controller.bff;

import com.sg.service.biz.bff.CommunicationService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Communication", tags = {"Communication"})
@RestController
// @RequestMapping("/oms/communication/")
public class CommunicationController {

    @Autowired
    CommunicationService communicationService;

    /**
     * B2更新变更消息内容
     * gen by moon at 1/25/2024, 10:05:48 PM
     */
    @PostMapping("/oms/communication/refreshChangeMessageContent")
    @ApiOperation(value = "B2更新变更消息内容", response = OkrResult.class)
    public OkrResult<BffRefreshChangeMessageContentRespDto> refreshChangeMessageContent(@RequestBody(required = false) @Validated BffRefreshChangeMessageContentReqDto reqDTO) {
        return OkrResult.success(communicationService.refreshChangeMessageContent(reqDTO));
    }

    /**
     * B2执行删除消息及相关
     * gen by moon at 1/25/2024, 10:22:22 PM
     */
    @PostMapping("/oms/communication/implementRemovalMessageCorrelation")
    @ApiOperation(value = "B2执行删除消息及相关", response = OkrResult.class)
    public OkrResult<BffImplementRemovalMessageCorrelationRespDto> implementRemovalMessageCorrelation(@RequestBody(required = false) @Validated BffImplementRemovalMessageCorrelationReqDto reqDTO) {
        return OkrResult.success(communicationService.implementRemovalMessageCorrelation(reqDTO));
    }

    /**
     * B2执行分享到部门大家想法
     * gen by moon at 1/26/2024, 1:15:11 AM
     */
    @PostMapping("/oms/communication/implementShareEveryoneIdeasDept")
    @ApiOperation(value = "B2执行分享到部门大家想法", response = OkrResult.class)
    public OkrResult<BffImplementShareEveryoneIdeasDeptRespDto> implementShareEveryoneIdeasDept(@RequestBody(required = false) @Validated BffImplementShareEveryoneIdeasDeptReqDto reqDTO) {
        return OkrResult.success(communicationService.implementShareEveryoneIdeasDept(reqDTO));
    }
}
